<template>
	<view class="content">
		<headerbox :cixitype="cixi"></headerbox>
		<view class="pages">
			<view class="card">
				<view class="card-body">
					<view class="display_space">
						<view class="label_title">可用积分</view>
						<view class="btns" @click="goSwichPage('/pages/menu/report_aig_point')">查看记录</view>
					</view>
					<view class="display_space" style="height: 52rpx;">
						<view class="text1">保险积分</view>
						<view>RMB 0</view>
					</view>
				</view>
			</view>
			<view class="card">
				<view class="card-body" style="padding-top: 80rpx;">
					<view class="color-highlight">USDT</view>
					<view class="row">
						<view class="my-3" @click="goSwichPageTow('/pages/user/transaction_history')">查看充值记录</view>
						<view class="rowtype">TRC20</view>
						<image class="erweima" :src="setting.alipay_qrcode2" mode=""></image>
						<view class="addr">{{setting.alipay_address2}}</view>
						<view class="addrcopy" @click="copy(setting.alipay_address2)">复制充值地址</view>
						<!-- <view class="fromitem">
							<input class="input" type="text" v-model="money" placeholder="人民币金额" />
							<view class="label">人民币金额</view>
						</view>
						<view class="convert">兑换率 : 7.30</view>
						<view class="convert">保险积分 123 = USDT 16.85</view>
						<view class="ammont">
							<view class="d-flex">
								<view class="items">¥2360</view>
								<view class="items">¥5960</view>
								<view class="items">¥11860</view>
								<view class="items">¥17760</view>
								<view class="items">¥23660</view>
								<view class="items">¥35460</view>
							</view>
						</view>
						<view class="fromitem">
							<input class="input" type="text" v-model="tradeID" placeholder="交易ID后六位" />
							<view class="label">交易ID后六位</view>
						</view>
						<view class="buttons">立即充值</view> -->
					</view>
				</view>
			</view>
			<!-- <view class="card card1">
				<view class="card-body">
					<view class="d-flex1">
						<image class="tishi" src="../../static/timg/tishi.png" mode=""></image>
						<view class="texts">
							USDT充值注意事项: 
							<br />
							提交订单时请准确填写交易ID后六位，否则将无法及时到账！
							<br />
							如果有任何问题请及时联系美亚娱乐国际在线客服咨询！
						</view>
						<view class="close"></view>
					</view>
				</view>
			</view> -->
		</view>
		<view class="footer-bar" :class="cixi ? '':'footer-bar-detached'">
			<view class="fbitem" @click="goSwichPage('/pages/index/index')">
				<view class="image">
					<image src="../../static/timg/shouye.png" mode=""></image>
				</view>
				<view class="text">首页</view>
			</view>
			<view class="fbitem" @click="goSwichPage('/pages/contract/contract')">
				<view class="image">
					<image src="../../static/timg/heyue.png" mode=""></image>
				</view>
				<view class="text">合约</view>
			</view>
			<view class="fbitem" @click="goSwichPage('/pages/user/assets')">
				<view class="image">
					<image src="../../static/timg/zichan.png" mode=""></image>
				</view>
				<view class="text">资产</view>
			</view>
			<view class="fbitem" @click="goSwichPage('/pages/user/claim')">
				<view class="image">
					<image src="../../static/timg/suopei.png" mode=""></image>
				</view>
				<view class="text">索赔</view>
			</view>
		</view>
	</view>
</template>

<script>
	import headerbox from '@/pages/header.vue'
	import {
		getuserinfo,
		ajaxpay,
		sysconfig
	} from '@/api/api.js'
	export default {
		components: {
			headerbox
		},
		data() {
			return {
				cixi: false,
				money: '',
				tradeID: '',

				userinfos: [],
				setting: []
			}
		},
		onLoad() {
			if (uni.getStorageSync('userinfo')) {
				this.userinfos = JSON.parse(uni.getStorageSync('userinfo'))
			} else {
				this.getuserinfofc()
			}
			this.getsysconfig()
		},
		onPageScroll(e) {
			if (e.scrollTop > 0) {
				this.cixi = true
			} else {
				this.cixi = false
			}
		},
		methods: {
			getuserinfofc() {
				let datas = {
					type: 1
				}
				getuserinfo(datas).then(res => {
					if (res.data.status.errorCode == 0) {
						this.userinfos = res.data.data.member
					}
				}).catch(err => {
					console.log(err)
				})
			},
			getsysconfig() {
				let datas = {
					type: 1
				}
				sysconfig(datas).then(res => {
					if (res.data.status.errorCode == 0) {
						this.setting = res.data.data
					}
				}).catch(err => {
					console.log(err)
				})
			},
			copy(value) {
				uni.setClipboardData({
					data: value,
					success: function() {
						//调用方法成功
						uni.showToast({
							title: '复制成功',
							icon: 'success',
							duration: 2000
						});
					}
				})
			},
			goSwichPage(page) {
				uni.navigateTo({
					url: page
				})
			},
			goSwichPageTow(page) {
				uni.navigateTo({
					url: page + '?isSelType=0'
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	* {
		box-sizing: border-box;
	}

	.content {
		width: 100%;
		min-height: 100vh;
		background-color: #f1f1f7;
		color: #747474 !important;
	}

	.pages {
		padding-top: calc(calc(110rpx + 60rpx) + env(safe-area-inset-top));
		padding-bottom: calc(120rpx + env(safe-area-inset-bottom));
	}

	.card {
		width: 94%;
		margin: 0 auto;
		border-radius: 20rpx;
		position: relative;
		display: flex;
		flex-direction: column;
		word-wrap: break-word;
		margin-bottom: 30rpx;
		background-color: #fff;
		box-shadow: rgba(0, 0, 0, .35) 0px 30px 60px -30px, rgba(0, 0, 0, .35) 0px -2px 6px 0px inset;
	}

	.card1 {
		background-color: rgba(74, 137, 220, 0.25) !important;
	}

	.card-body {
		z-index: 3;
		flex: 1 1 auto;
		padding: 40rpx;
	}

	.display_space {
		font-size: 26rpx;
		font-weight: bold;
		color: #2a2a2a;
		margin-bottom: 4rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.label_title {
		font-size: 28rpx;
		font-weight: bold;
	}

	.btns {
		font-size: 22rpx;
		padding: 16rpx 26rpx;
		font-weight: 700;
		border-radius: 24rpx;
		box-shadow: 0 5px 14px 0 rgba(0, 0, 0, 0.1);
		background-image: linear-gradient(to bottom, #5D9CEC, #4A89DC) !important;
		color: #FFF !important;
		line-height: 1.5;
	}

	.text1 {
		font-size: 26rpx;
		color: #c5993a;
	}

	.color-highlight {
		background-color: #4A89DC;
		border-color: #4A89DC;
		color: #FFF !important;
		text-align: center;
		width: 100%;
		font-size: 26rpx;
		height: 74rpx;
		line-height: 74rpx;
		font-weight: 600;
		border-radius: 30rpx;
		margin-bottom: 20rpx;
	}

	.row {
		width: 100%;
		padding-top: 40rpx;
	}

	.my-3 {
		font-size: 22rpx;
		padding: 16rpx 26rpx;
		font-weight: 700;
		text-align: center;
		color: #fff;
		box-shadow: 0 5px 14px 0 rgba(0, 0, 0, 0.1);
		background-image: linear-gradient(to bottom, #5D9CEC, #4A89DC);
		line-height: 1.5;
		border-radius: 24rpx;
		margin-bottom: 40rpx;
	}

	.rowtype {
		width: 100%;
		text-align: center;
		line-height: 48rpx;
		font-size: 28rpx;
		color: #747474 !important;
	}

	.erweima {
		width: 512rpx;
		height: 512rpx;
		display: block;
		margin: 0 auto;
	}

	.addr {
		text-align: center;
		line-height: 50rpx;
		font-size: 28rpx;
		font-weight: bold;
	}

	.addrcopy {
		background: #3c9948;
		margin: 0 auto;
		margin-bottom: 40rpx;
		padding: 0 16rpx;
		border-radius: 16rpx;
		height: 48rpx;
		line-height: 48rpx;
		font-weight: 700;
		font-size: 24rpx;
		color: #FFF;
		width: fit-content;
	}

	.fromitem {
		position: relative;
		margin-bottom: 40rpx;
	}

	.input {
		width: 100%;
		height: 106rpx;
		line-height: 102rpx;
		border: 2rpx solid rgba(0, 0, 0, 0.07) !important;
		padding-left: 40rpx;
		padding-right: 40rpx;
		border-radius: 20rpx;
		font-size: 24rpx;
		outline: 0;
		color: #000;
	}

	.label {
		position: absolute;
		top: -10rpx;
		height: 20rpx;
		line-height: 20rpx;
		left: 0;
		font-size: 22rpx;
		text-transform: uppercase;
		font-family: "Nunito", sans-serif;
		font-weight: 700;
		transition: all 250ms ease;
		padding-left: 2px !important;
		padding-right: 5px !important;
		color: #0f1117;
		transform: translateX(80rpx) !important;
		margin-left: -64rpx !important;
	}

	.convert {
		font-size: 32rpx;
		line-height: 44rpx;
		font-weight: 700;
		margin-bottom: 10rpx;
		color: #1b1b1b;
	}

	.ammont {
		padding-top: 20rpx;
		margin-bottom: 40rpx;
	}

	.d-flex {
		width: 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
		flex-wrap: wrap;
	}

	.d-flex .items:nth-child(-n+3) {
		margin-bottom: 40rpx;
	}

	.items {
		width: 200rpx;
		height: 60rpx;
		line-height: 60rpx;
		border-radius: 35rpx;
		border: solid 2rpx #eaeaea;
		background-color: #fff;
		font-size: 26rpx;
		font-weight: bold;
		color: #000000;
		text-align: center;
	}

	.buttons {
		width: 100%;
		text-align: center;
		font-size: 24rpx;
		font-weight: 700 !important;
		padding: 24rpx 36rpx;
		box-shadow: 0 10rpx 28rpx 0 rgba(0, 0, 0, 0.1);
		background-color: #4A89DC !important;
		color: #FFF !important;
		border-radius: 20rpx !important;
		margin-top: 60rpx;
	}

	.d-flex1 {
		display: flex;
		align-items: center;
	}

	.tishi {
		width: 66rpx;
		height: 66rpx;
	}

	.texts {
		flex: 1;
		font-size: 28rpx;
		line-height: 36rpx;
		color: #4A89DC !important;
		padding-left: 40rpx;
		padding-right: 20rpx;
		font-weight: 500;
	}

	.close {
		width: 22rpx;
		height: 22rpx;
		background: transparent url('../../static/timg/guanbi.svg') center / 22rpx auto no-repeat;
		opacity: 0.2 !important;
	}

	.footer-bar {
		background-color: rgba(255, 255, 255, 0.95);
		padding: 0px 20rpx;
		position: fixed;
		bottom: 0px;
		left: 0px;
		right: 0px;
		z-index: 98;
		backdrop-filter: blur(20rpx);
		display: flex;
		text-align: center;
		transition: all 250ms ease;
		height: calc(120rpx + env(safe-area-inset-bottom));
		box-shadow: 0 -10rpx 10rpx 0 rgba(0, 0, 0, 0.04);
	}

	.footer-bar.footer-bar-detached {
		border-radius: 40rpx;
		left: 20rpx !important;
		right: 20rpx !important;
		bottom: 30rpx !important;
		box-shadow: 0 0px 30rpx 0 rgba(0, 0, 0, 0.1) !important;
		height: 120rpx !important;
	}

	.fbitem {
		color: #818181;
		position: relative;
		flex: 1 1 auto;
		padding-top: 24rpx;

		.image {
			height: 48rpx;
			margin-top: -4rpx;

			image {
				width: 36rpx;
				height: 36rpx;
			}
		}

		.text {
			height: 48rpx;
			margin-top: -6rpx;
			font-size: 24rpx;
			opacity: 0.7;
			color: #818181;
		}
	}
</style>